package 课工场练习;

import java.util.Scanner;

public class Rent {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		Operation operation = new Operation();
		// 租赁公司界面
		operation.init();
		System.out.println("**********欢迎光临租赁公司**********");
		System.out.println("1.轿车\t\t2.客车");
		System.out.println("请选择您要租赁的汽车类型：（1.轿车  2.客车）");
		int cheType = input.nextInt();
		String brand = "";// 品牌
		String type = "";// 型号
		int seatCount = 0;// 座位数
		// 收集用户条件
		if (cheType == 1) {
			// 租赁轿车
			System.out.println("请选择您要租赁的轿车品牌：（1.别克  2.宝马）");
			int choose = input.nextInt();
			if (choose == 1) {
				brand = "别克";
				System.out.println("请选择您要租赁的汽车型号：（1.林荫大道  2.GL8）");
				type = (input.nextInt() == 1) ? "林荫大道" : "GL8";
			} else if (choose == 2) {
				brand = "宝马";
				System.out.println("请选择您要租赁的汽车型号：（1.X6  2.550i）");
				type = (input.nextInt() == 1) ? "X6" : "550i";
			}

		} else if (cheType == 2) {
			// 租赁客车
			type = "";
			System.out.println("请选择您要租赁的客车品牌：（1.金杯  2.金龙）");
			brand = (input.nextInt() == 1) ? "金杯" : "金龙";
			System.out.println("请选择您要租赁的客车座位数：（1.16座  2.32座）");
			seatCount = (input.nextInt() == 1) ? 16 : 34;
		}
		// 租车
		Vehicle che = operation.zuChe(brand, type, seatCount);
		System.out.println("请输入您的租赁天数：");
		int days = input.nextInt();
		double money = che.calcRent(days);
		System.out.println("租车成功，请按照如下车牌号提车：" + che.getId());
		System.out.println("您需要支付：" + money + "元");
	}
}
